package smetana.domain.raw;

import java.sql.Date;

import com.google.common.base.Preconditions;
import smetana.domain.AbstractEntity;

import static org.apache.commons.lang.StringUtils.defaultString;

public class Agent extends AbstractEntity {
    private int id;
    private Date dateStart;
    private Date dateEnd;
    private String agentName;
    private String address;
    private String phone;

    protected Agent() {
        //used by iBatis.
    }

    public Agent(int id) {
        this.id = id;
    }

    @Override
    public int getId() {
        return this.id;
    }

    protected void setId(int id) {
        this.id = id;
    }

    public Date getDateStart() {
        return this.dateStart;
    }

    protected void setDateStart(Date dateStart) {
        this.dateStart = Preconditions.checkNotNull(dateStart);
    }

    public Date getDateEnd() {
        return this.dateEnd;
    }

    public void setDateEnd(Date dateEnd) {
        this.dateEnd = Preconditions.checkNotNull(dateEnd);
    }

    public String getAgentName() {
        return defaultString(this.agentName);
    }

    public void setAgentName(String agentName) {
        this.agentName = Preconditions.checkNotNull(agentName);
    }

    public String getAddress() {
        return defaultString(this.address);
    }

    public void setAddress(String address) {
        this.address = Preconditions.checkNotNull(address);
    }

    public String getPhone() {
        return defaultString(this.phone);
    }

    public void setPhone(String phone) {
        this.phone = Preconditions.checkNotNull(phone);
    }
}